<template>
  <div class="personPre">
    <el-card :shadow="shadowShow">
      <!-- <div class="top">
          <div class="person_nav">
              {{$t('personPre.pianhao1')}}
          </div>
          <div class="orderReceiving">
              <span>开启下载即默认接单</span>
              <el-switch @change="((val) => { switchChange(val, 3) })" v-model="switchForm.receivingOrders"
                  active-color="#003E67" inactive-color="#C5C5C5" active-value="2" inactive-value="0">
              </el-switch>
          </div>
      </div>
      <div class="top" style="margin-top: 30px;">
          <div class="person_nav">
              审核报告设置
          </div>
          <div class="orderReceiving">
              <span>{{ $t('add.add184') }}</span>
              <el-switch @change="((val) => { switchChange(val, 4) })" v-model="switchForm.jurisdiction"
                  active-color="#003E67" inactive-color="#C5C5C5" active-value="1" inactive-value="0">
              </el-switch>
          </div>
      </div> -->

      <div class="bottom">
        <div class="person_nav">
          <div>{{ $t('personPre.pianhao5') }}</div>
          <div style="display: flex" :style="{ width: lang !== 'cn' ? '433px' : '336px' }">
            <div
              class="item_email"
              style="display: flex; align-items: center; justify-content: right"
              :style="{ width: lang !== 'cn' ? '145px' : '108px' }"
            >
              <!-- 邮箱通知 -->
              <el-tooltip
                class="item"
                effect="dark"
                :content="$t('personPre.pianhao30')"
                placement="top"
              >
                <span
                  class="ellipsis"
                  style="
                    display: inline-block;
                    text-align: right;
                    padding-right: 12px;
                    width: 100px;
                  "
                >
                  {{ $t('personPre.pianhao30') }}
                </span>
              </el-tooltip>
              <el-switch
                v-model="xxtzForm.zongYouxiang"
                :disabled="caminho === 'mobile'"
                active-color="#003E67"
                inactive-color="#C5C5C5"
                active-value="1"
                inactive-value="0"
                @change="
                  (val) => {
                    allChange(val, 1);
                  }
                "
              />
            </div>
            <div
              class="item_phone"
              style="margin-left: 80px; display: flex; align-items: center; justify-content: right"
              :style="{ width: lang !== 'cn' ? '168px' : '108px' }"
            >
              <!-- 消息通知 -->
              <el-tooltip
                class="item"
                effect="dark"
                :content="$t('personPre.pianhao30')"
                placement="top"
              >
                <span
                  class="ellipsis"
                  style="
                    display: inline-block;
                    text-align: right;
                    padding-right: 12px;
                    width: 100px;
                  "
                >
                  {{ $t('personPre.pianhao31') }}
                </span>
              </el-tooltip>
              <el-switch
                v-model="xxtzForm.zongXiaoxi"
                active-color="#003E67"
                inactive-color="#C5C5C5"
                active-value="1"
                inactive-value="0"
                @change="
                  (val) => {
                    allChange(val, 2);
                  }
                "
              />
            </div>
            <!-- <el-switch @change="allChange" v-model="allStatus" active-color="#003E67" inactive-color="#C5C5C5"
                active-value="1" inactive-value="0">
            </el-switch> -->
          </div>
        </div>
        <div>
          <el-tabs v-model="activeName" @tab-click="handleClick">
            <el-tab-pane :label="$t('personPre.pianhao6')" name="first" />
            <el-tab-pane :label="$t('personPre.pianhao7')" name="second" />
            <el-tab-pane :label="$t('personPre.pianhao8')" name="third" />
            <el-tab-pane :label="$t('personPre.pianhao9')" name="fourth" />
          </el-tabs>
          <div class="switch_info">
            <div v-if="activeName == 'first'" class="switch_inner">
              <div class="switch_item">
                <el-tooltip
                  class="item"
                  effect="dark"
                  :content="$t('personPre.pianhao10')"
                  placement="top"
                >
                  <span class="item_title">{{ $t('personPre.pianhao10') }}</span>
                </el-tooltip>

                <div class="switch">
                  <div class="item_email">
                    <span>{{ $t('personPre.pianhao11') }}</span>
                    <el-switch
                      v-model="xxtzForm.xddYouxiang"
                      :disabled="caminho === 'mobile'"
                      active-color="#003E67"
                      inactive-color="#C5C5C5"
                      active-value="1"
                      inactive-value="0"
                      @change="
                        (val) => {
                          switchChange(val, 5);
                        }
                      "
                    />
                  </div>
                  <div class="item_phone">
                    <span>{{ $t('personPre.pianhao12') }}</span>
                    <el-switch
                      v-model="xxtzForm.xddXiaoxi"
                      active-color="#003E67"
                      inactive-color="#C5C5C5"
                      active-value="1"
                      inactive-value="0"
                      @change="
                        (val) => {
                          switchChange(val, 6);
                        }
                      "
                    />
                  </div>
                </div>
              </div>
              <div class="switch_item">
                <el-tooltip
                  class="item"
                  effect="dark"
                  :content="$t('personPre.pianhao13')"
                  placement="top"
                >
                  <span class="item_title">{{ $t('personPre.pianhao13') }}</span>
                </el-tooltip>

                <div class="switch">
                  <div class="item_email">
                    <span>{{ $t('personPre.pianhao11') }}</span>
                    <el-switch
                      v-model="xxtzForm.ddjdYouxiang"
                      :disabled="caminho === 'mobile'"
                      active-color="#003E67"
                      inactive-color="#C5C5C5"
                      active-value="1"
                      inactive-value="0"
                      @change="
                        (val) => {
                          switchChange(val, 7);
                        }
                      "
                    />
                  </div>
                  <div class="item_phone">
                    <span>{{ $t('personPre.pianhao12') }}</span>
                    <el-switch
                      v-model="xxtzForm.ddjdXiaoxi"
                      active-color="#003E67"
                      inactive-color="#C5C5C5"
                      active-value="1"
                      inactive-value="0"
                      @change="
                        (val) => {
                          switchChange(val, 8);
                        }
                      "
                    />
                  </div>
                </div>
              </div>
              <div class="switch_item">
                <el-tooltip
                  class="item"
                  effect="dark"
                  :content="$t('personPre.pianhao14')"
                  placement="top"
                >
                  <span class="item_title">{{ $t('personPre.pianhao14') }}</span>
                </el-tooltip>

                <div class="switch">
                  <div class="item_email">
                    <span>{{ $t('personPre.pianhao11') }}</span>
                    <el-switch
                      v-model="xxtzForm.xsjYouxiang"
                      :disabled="caminho === 'mobile'"
                      active-color="#003E67"
                      inactive-color="#C5C5C5"
                      active-value="1"
                      inactive-value="0"
                      @change="
                        (val) => {
                          switchChange(val, 9);
                        }
                      "
                    />
                  </div>
                  <div class="item_phone">
                    <span>{{ $t('personPre.pianhao12') }}</span>
                    <el-switch
                      v-model="xxtzForm.xsjXiaoxi"
                      active-color="#003E67"
                      inactive-color="#C5C5C5"
                      active-value="1"
                      inactive-value="0"
                      @change="
                        (val) => {
                          switchChange(val, 10);
                        }
                      "
                    />
                  </div>
                </div>
              </div>
              <div class="switch_item">
                <el-tooltip
                  class="item"
                  effect="dark"
                  :content="$t('personPre.pianhao15')"
                  placement="top"
                >
                  <span class="item_title">{{ $t('personPre.pianhao15') }}</span>
                </el-tooltip>

                <div class="switch">
                  <div class="item_email">
                    <span>{{ $t('personPre.pianhao11') }}</span>
                    <el-switch
                      v-model="xxtzForm.xwlYouxiang"
                       :disabled="caminho === 'mobile'"
                      active-color="#003E67"
                      inactive-color="#C5C5C5"
                      active-value="1"
                      inactive-value="0"
                      @change="
                        (val) => {
                          switchChange(val, 11);
                        }
                      "
                    />
                  </div>
                  <div class="item_phone">
                    <span>{{ $t('personPre.pianhao12') }}</span>
                    <el-switch
                      v-model="xxtzForm.xwlXiaoxi"
                      active-color="#003E67"
                      inactive-color="#C5C5C5"
                      active-value="1"
                      inactive-value="0"
                      @change="
                        (val) => {
                          switchChange(val, 12);
                        }
                      "
                    />
                  </div>
                </div>
              </div>
              <div class="switch_item">
                <el-tooltip
                  class="item"
                  effect="dark"
                  :content="$t('personPre.pianhao16')"
                  placement="top"
                >
                  <span class="item_title">{{ $t('personPre.pianhao16') }}</span>
                </el-tooltip>

                <div class="switch">
                  <div class="item_email">
                    <span>{{ $t('personPre.pianhao11') }}</span>
                    <el-switch
                      v-model="xxtzForm.ddqtYouxiang"
                      :disabled="caminho === 'mobile'"
                      active-color="#003E67"
                      inactive-color="#C5C5C5"
                      active-value="1"
                      inactive-value="0"
                      @change="
                        (val) => {
                          switchChange(val, 13);
                        }
                      "
                    />
                  </div>
                  <div class="item_phone">
                    <span>{{ $t('personPre.pianhao12') }}</span>
                    <el-switch
                      v-model="xxtzForm.ddqtXiaoxi"
                      active-color="#003E67"
                      inactive-color="#C5C5C5"
                      active-value="1"
                      inactive-value="0"
                      @change="
                        (val) => {
                          switchChange(val, 14);
                        }
                      "
                    />
                  </div>
                </div>
              </div>
            </div>

            <div v-if="activeName == 'second'" class="message">
              <!-- <div class="type_title">
                  <span>{{ $t('personPre.pianhao17') }}</span>
              </div> -->
              <div class="switch_inner">
                <div class="switch_item">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    :content="$t('personPre.pianhao18')"
                    placement="top"
                  >
                    <span class="item_title">{{ $t('personPre.pianhao18') }}</span>
                  </el-tooltip>

                  <div class="switch">
                    <div class="item_email">
                      <span>{{ $t('personPre.pianhao11') }}</span>
                      <el-switch
                        v-model="xxtzForm.xjsxxYouxiang"
                        :disabled="caminho === 'mobile'"
                        active-color="#003E67"
                        inactive-color="#C5C5C5"
                        active-value="1"
                        inactive-value="0"
                        @change="
                          (val) => {
                            switchChange(val, 15);
                          }
                        "
                      />
                    </div>
                    <div class="item_phone">
                      <span>{{ $t('personPre.pianhao12') }}</span>
                      <el-switch
                        v-model="xxtzForm.xjsxxXiaoxi"
                      
                        active-color="#003E67"
                        inactive-color="#C5C5C5"
                        active-value="1"
                        inactive-value="0"
                        @change="
                          (val) => {
                            switchChange(val, 16);
                          }
                        "
                      />
                    </div>
                  </div>
                </div>
                <div class="switch_item">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    :content="$t('personPre.pianhao19')"
                    placement="top"
                  >
                    <span class="item_title">{{ $t('personPre.pianhao19') }}</span>
                  </el-tooltip>

                  <div class="switch">
                    <div class="item_email">
                      <span>{{ $t('personPre.pianhao11') }}</span>
                      <el-switch
                        v-model="xxtzForm.mmczYouxiang"
                         :disabled="caminho === 'mobile'"
                        active-color="#003E67"
                        inactive-color="#C5C5C5"
                        active-value="1"
                        inactive-value="0"
                        @change="
                          (val) => {
                            switchChange(val, 17);
                          }
                        "
                      />
                    </div>
                    <div class="item_phone">
                      <span>{{ $t('personPre.pianhao12') }}</span>
                      <el-switch
                        v-model="xxtzForm.mmczXiaoxi"
                        active-color="#003E67"
                        inactive-color="#C5C5C5"
                        active-value="1"
                        inactive-value="0"
                        @change="
                          (val) => {
                            switchChange(val, 18);
                          }
                        "
                      />
                    </div>
                  </div>
                </div>
              </div>
            </div>

            <div v-if="activeName == 'third'" class="partner">
              <!-- <div class="type_title">
                  <span>{{ $t('personPre.pianhao20') }}</span>
              </div> -->
              <div class="switch_inner">
                <div class="switch_item">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    :content="$t('add.add031')"
                    placement="top"
                  >
                    <span class="item_title">{{ $t('add.add031') }}</span>
                  </el-tooltip>

                  <div class="switch">
                    <div class="item_email">
                      <span>{{ $t('personPre.pianhao11') }}</span>
                      <el-switch
                        v-model="xxtzForm.xhzhbYouxiang"
                         :disabled="caminho === 'mobile'"
                        active-color="#003E67"
                        inactive-color="#C5C5C5"
                        active-value="1"
                        inactive-value="0"
                        @change="
                          (val) => {
                            switchChange(val, 19);
                          }
                        "
                      />
                    </div>
                    <div class="item_phone">
                      <span>{{ $t('personPre.pianhao12') }}</span>
                      <el-switch
                        v-model="xxtzForm.xhzhbXiaoxi"
                        active-color="#003E67"
                        inactive-color="#C5C5C5"
                        active-value="1"
                        inactive-value="0"
                        @change="
                          (val) => {
                            switchChange(val, 20);
                          }
                        "
                      />
                    </div>
                  </div>
                </div>
                <div class="switch_item">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    :content="$t('personPre.pianhao21')"
                    placement="top"
                  >
                    <span class="item_title">{{ $t('personPre.pianhao21') }}</span>
                  </el-tooltip>

                  <div class="switch">
                    <div class="item_email">
                      <span>{{ $t('personPre.pianhao11') }}</span>
                      <el-switch
                        v-model="xxtzForm.hzscYouxiang"
                          :disabled="caminho === 'mobile'"
                        active-color="#003E67"
                        inactive-color="#C5C5C5"
                        active-value="1"
                        inactive-value="0"
                        @change="
                          (val) => {
                            switchChange(val, 21);
                          }
                        "
                      />
                    </div>
                    <div class="item_phone">
                      <span>{{ $t('personPre.pianhao12') }}</span>
                      <el-switch
                        v-model="xxtzForm.hzscXiaoxi"
                        active-color="#003E67"
                        inactive-color="#C5C5C5"
                        active-value="1"
                        inactive-value="0"
                        @change="
                          (val) => {
                            switchChange(val, 22);
                          }
                        "
                      />
                    </div>
                  </div>
                </div>
                <div class="switch_item">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    :content="$t('personPre.pianhao22')"
                    placement="top"
                  >
                    <span class="item_title">{{ $t('personPre.pianhao22') }}</span>
                  </el-tooltip>

                  <div class="switch">
                    <div class="item_email">
                      <span>{{ $t('personPre.pianhao11') }}</span>
                      <el-switch
                        :disabled="caminho === 'mobile'"
                        v-model="xxtzForm.hzsqYouxiang"
                        active-color="#003E67"
                        inactive-color="#C5C5C5"
                        active-value="1"
                        inactive-value="0"
                        @change="
                          (val) => {
                            switchChange(val, 23);
                          }
                        "
                      />
                    </div>
                    <div class="item_phone">
                      <span>{{ $t('personPre.pianhao12') }}</span>
                      <el-switch
                        v-model="xxtzForm.hzsqXiaoxi"
                        active-color="#003E67"
                        inactive-color="#C5C5C5"
                        active-value="1"
                        inactive-value="0"
                        @change="
                          (val) => {
                            switchChange(val, 24);
                          }
                        "
                      />
                    </div>
                  </div>
                </div>
              </div>
            </div>

            <div v-if="activeName == 'fourth'" class="member">
              <!-- <div class="type_title">
                  <span>{{ $t('personPre.pianhao23') }}</span>
              </div> -->
              <div class="switch_inner">
                <div class="switch_item">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    :content="$t('personPre.pianhao24')"
                    placement="top"
                  >
                    <span class="item_title">{{ $t('personPre.pianhao24') }}</span>
                  </el-tooltip>

                  <div class="switch">
                    <div class="item_email">
                      <span>{{ $t('personPre.pianhao11') }}</span>
                      <el-switch
                        v-model="xxtzForm.cyjsYouxiang"
                        :disabled="caminho === 'mobile'"
                        active-color="#003E67"
                        inactive-color="#C5C5C5"
                        active-value="1"
                        inactive-value="0"
                        @change="
                          (val) => {
                            switchChange(val, 25);
                          }
                        "
                      />
                    </div>
                    <div class="item_phone">
                      <span>{{ $t('personPre.pianhao12') }}</span>
                      <el-switch
                        v-model="xxtzForm.cyjsXiaoxi"
                        active-color="#003E67"
                        inactive-color="#C5C5C5"
                        active-value="1"
                        inactive-value="0"
                        @change="
                          (val) => {
                            switchChange(val, 26);
                          }
                        "
                      />
                    </div>
                  </div>
                </div>
                <div class="switch_item">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    :content="$t('personPre.pianhao25')"
                    placement="top"
                  >
                    <span class="item_title">{{ $t('personPre.pianhao25') }}</span>
                  </el-tooltip>

                  <div class="switch">
                    <div class="item_email">
                      <span>{{ $t('personPre.pianhao11') }}</span>
                      <el-switch
                        v-model="xxtzForm.cyyqYouxiang"
                         :disabled="caminho === 'mobile'"
                        active-color="#003E67"
                        inactive-color="#C5C5C5"
                        active-value="1"
                        inactive-value="0"
                        @change="
                          (val) => {
                            switchChange(val, 27);
                          }
                        "
                      />
                    </div>
                    <div class="item_phone">
                      <span>{{ $t('personPre.pianhao12') }}</span>
                      <el-switch
                        v-model="xxtzForm.cyyqXiaoxi"
                        active-color="#003E67"
                        inactive-color="#C5C5C5"
                        active-value="1"
                        inactive-value="0"
                        @change="
                          (val) => {
                            switchChange(val, 28);
                          }
                        "
                      />
                    </div>
                  </div>
                </div>
                <div class="switch_item">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    :content="$t('personPre.pianhao26')"
                    placement="top"
                  >
                    <span class="item_title">{{ $t('personPre.pianhao26') }}</span>
                  </el-tooltip>

                  <div class="switch">
                    <div class="item_email">
                      <span>{{ $t('personPre.pianhao11') }}</span>
                      <el-switch
                        v-model="xxtzForm.xcyYouxiang"
                         :disabled="caminho === 'mobile'"
                        active-color="#003E67"
                        inactive-color="#C5C5C5"
                        active-value="1"
                        inactive-value="0"
                        @change="
                          (val) => {
                            switchChange(val, 29);
                          }
                        "
                      />
                    </div>
                    <div class="item_phone">
                      <span>{{ $t('personPre.pianhao12') }}</span>
                      <el-switch
                        v-model="xxtzForm.xcyXiaoxi"
                        active-color="#003E67"
                        inactive-color="#C5C5C5"
                        active-value="1"
                        inactive-value="0"
                        @change="
                          (val) => {
                            switchChange(val, 30);
                          }
                        "
                      />
                    </div>
                  </div>
                </div>
                <div class="switch_item">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    :content="$t('personPre.pianhao27')"
                    placement="top"
                  >
                    <span class="item_title">{{ $t('personPre.pianhao27') }}</span>
                  </el-tooltip>

                  <div class="switch">
                    <div class="item_email">
                      <span>{{ $t('personPre.pianhao11') }}</span>
                      <el-switch
                        v-model="xxtzForm.cyzdYouxiang"
                         :disabled="caminho === 'mobile'"
                        active-color="#003E67"
                        inactive-color="#C5C5C5"
                        active-value="1"
                        inactive-value="0"
                        @change="
                          (val) => {
                            switchChange(val, 31);
                          }
                        "
                      />
                    </div>
                    <div class="item_phone">
                      <span>{{ $t('personPre.pianhao12') }}</span>
                      <el-switch
                        v-model="xxtzForm.cyzdXiaoxi"
                        active-color="#003E67"
                        inactive-color="#C5C5C5"
                        active-value="1"
                        inactive-value="0"
                        @change="
                          (val) => {
                            switchChange(val, 32);
                          }
                        "
                      />
                    </div>
                  </div>
                </div>
                <div class="switch_item">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    :content="$t('add.add032')"
                    placement="top"
                  >
                    <span class="item_title">{{ $t('add.add032') }}</span>
                  </el-tooltip>

                  <div class="switch">
                    <div class="item_email">
                      <span>{{ $t('personPre.pianhao11') }}</span>
                      <el-switch
                        v-model="xxtzForm.cyycYouxiang"
                        :disabled="caminho === 'mobile'"
                        active-color="#003E67"
                        inactive-color="#C5C5C5"
                        active-value="1"
                        inactive-value="0"
                        @change="
                          (val) => {
                            switchChange(val, 33);
                          }
                        "
                      />
                    </div>
                    <div class="item_phone">
                      <span>{{ $t('personPre.pianhao12') }}</span>
                      <el-switch
                        v-model="xxtzForm.cyycXiaoxi"
                        active-color="#003E67"
                        inactive-color="#C5C5C5"
                        active-value="1"
                        inactive-value="0"
                        @change="
                          (val) => {
                            switchChange(val, 34);
                          }
                        "
                      />
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </el-card>
  </div>
</template>

<script>
export default {
  name: 'BLZMasterIndex',

  data() {
    return {
      caminho: '',
      lang: 'cn',
      // tab切换
      activeName: 'first',
      // 是否
      orderReceiving: '',
      // 订单通知
      orderList: [
        { title: '新订单通知', email: false, phone: false },
        { title: '订单接单通知', email: false, phone: false },
        { title: '新设计方案通知', email: false, phone: false },
        { title: '新物流信息通知', email: false, phone: false },
        { title: '订单其他状态变化通知', email: false, phone: false },
      ],
      // 即时消息通知
      messageList: [
        { title: '新即时消息通知', email: false, phone: false },
        { title: '密码重置通知', email: false, phone: false },
      ],
      // 合作伙伴通知
      partnerList: [
        { title: this.$t('add.add031'), email: false, phone: false },
        { title: '合作删除通知', email: false, phone: false },
        { title: '合作申请结果通知', email: false, phone: false },
      ],
      // 成员通知
      memberList: [
        { title: '成员接受拒绝通知', email: false, phone: false },
        { title: '成员邀请及权限变化通知', email: false, phone: false },
        { title: '新成员申请通知', email: false, phone: false },
        { title: '成员主动退出通知', email: false, phone: false },
      ],
      switchArr: [],
      switchForm: {
        receivingOrders: null, // 接单
        jurisdiction: null, // 权限
      },
      xxtzForm: {
        zongYouxiang: null,
        zongXiaoxi: null,

        xddYouxiang: null,
        xddXiaoxi: null,
        ddjdYouxiang: null,
        ddjdXiaoxi: null,
        xsjYouxiang: null,
        xsjXiaoxi: null,
        xwlYouxiang: null,
        xwlXiaoxi: null,
        ddqtYouxiang: null,
        ddqtXiaoxi: null,

        xjsxxXiaoxi: null,
        xjsxxYouxiang: null,
        mmczYouxiang: null,
        mmczXiaoxi: null,

        hzhbYouxiang: null,
        hzhbXiaoxi: null,
        xhzhbYouxiang: null,
        xhzhbXiaoxi: null,
        hzscYouxiang: null,
        hzscXiaoxi: null,
        hzsqYouxiang: null,
        hzsqXiaoxi: null,

        cyjsXiaoxi: null,
        cyjsYouxiang: null,
        cyyqXiaoxi: null,
        cyyqYouxiang: null,
        xcyYouxiang: null,
        xcyXiaoxi: null,
        cyzdYouxiang: null,
        cyzdXiaoxi: null,
        cyycYouxiang: null,
        cyycXiaoxi: null,
      },
      dingdanArr: [],
      dingdanArr4: [],
      dingdanArr5: [],
      dingdanArr6: [],
      allStatus: 1,
    };
  },

  created() {
    // 获取当前是手机号还是邮箱登录的
    this.getLoginCaminho();
    this.jurisdiction();
    this.jurisdiction3();
  },
  mounted() {
    this.lang = localStorage.getItem('lang');
  },
  methods: {
    getLoginCaminho() {
      this.$http
        .get(`/sys/dict/data/verifyLoginMethod`)
        .then(({ data: res }) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg);
          } else {
            this.caminho = res.data;
          }
        })
        .catch((err) => {
          console.log('err', err);
        });
    },
    // tab 切换
    handleClick(val) {
      console.log('val', val.name);
      if (val.name == 'first') {
        this.jurisdiction3();
      } else if (val.name == 'second') {
        this.jurisdiction4();
      } else if (val.name == 'third') {
        this.jurisdiction5();
      } else if (val.name == 'fourth') {
        this.jurisdiction6();
      }
    },
    // 总按钮
    allChange(val, num) {
      this.$http
        .post(`/sys/dict/data/switchAll?status=${val}&type=${num}`)
        .then(({ data: res }) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg);
          } else {
            this.handleClick({ name: this.activeName });
          }
        })
        .catch((err) => {
          console.log('err', err);
        });
    },
    jurisdiction() {
      this.$http
        .get('/sys/dict/data/page?dictTypeId=2')
        .then(({ data: res }) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg);
          } else {
            this.allStatus = res.data.list[0].dictValue;
            res.data.list.forEach((item) => {
              // 3 邮件
              if (item.id == '3') {
                this.xxtzForm.zongYouxiang = item.dictValue;
              }
              // 4 消息
              if (item.id == '4') {
                this.xxtzForm.zongXiaoxi = item.dictValue;
              }
            });
          }
        })
        .catch((err) => {
          console.log('err', err);
        });
    },
    jurisdiction3() {
      this.$http
        .get('/sys/dict/data/page?dictTypeId=3')
        .then(({ data: res }) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg);
          } else {
            this.dingdanArr = res.data.list;
            this.dingdanArr.forEach((item) => {
              if (item.id == '5') {
                this.xxtzForm.xddYouxiang = item.dictValue;
              }
              if (item.id == '6') {
                this.xxtzForm.xddXiaoxi = item.dictValue;
              }
              if (item.id == '7') {
                this.xxtzForm.ddjdYouxiang = item.dictValue;
              }
              if (item.id == '8') {
                this.xxtzForm.ddjdXiaoxi = item.dictValue;
              }
              if (item.id == '9') {
                this.xxtzForm.xsjYouxiang = item.dictValue;
              }
              if (item.id == '10') {
                this.xxtzForm.xsjXiaoxi = item.dictValue;
              }
              if (item.id == '11') {
                this.xxtzForm.xwlYouxiang = item.dictValue;
              }
              if (item.id == '12') {
                this.xxtzForm.xwlXiaoxi = item.dictValue;
              }
              if (item.id == '13') {
                this.xxtzForm.ddqtYouxiang = item.dictValue;
              }
              if (item.id == '14') {
                this.xxtzForm.ddqtXiaoxi = item.dictValue;
              }
            });
          }
        })
        .catch((err) => {
          console.log('err', err);
        });
    },
    jurisdiction4() {
      this.$http
        .get('/sys/dict/data/page?dictTypeId=4')
        .then(({ data: res }) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg);
          } else {
            this.dingdanArr4 = res.data.list;
            this.dingdanArr4.forEach((item) => {
              if (item.id == '15') {
                this.xxtzForm.xjsxxYouxiang = item.dictValue;
              }
              if (item.id == '16') {
                this.xxtzForm.xjsxxXiaoxi = item.dictValue;
              }
              if (item.id == '17') {
                this.xxtzForm.mmczYouxiang = item.dictValue;
              }
              if (item.id == '18') {
                this.xxtzForm.mmczXiaoxi = item.dictValue;
              }
            });
          }
        })
        .catch((err) => {
          console.log('err', err);
        });
    },
    jurisdiction5() {
      this.$http
        .get('/sys/dict/data/page?dictTypeId=5')
        .then(({ data: res }) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg);
          } else {
            this.dingdanArr5 = res.data.list;
            this.dingdanArr5.forEach((item) => {
              if (item.id == '19') {
                this.xxtzForm.xhzhbYouxiang = item.dictValue;
              }
              if (item.id == '20') {
                this.xxtzForm.xhzhbXiaoxi = item.dictValue;
              }
              if (item.id == '21') {
                this.xxtzForm.hzscYouxiang = item.dictValue;
              }
              if (item.id == '22') {
                this.xxtzForm.hzscXiaoxi = item.dictValue;
              }
              if (item.id == '23') {
                this.xxtzForm.hzsqYouxiang = item.dictValue;
              }
              if (item.id == '24') {
                this.xxtzForm.hzsqXiaoxi = item.dictValue;
              }
            });
          }
        })
        .catch((err) => {
          console.log('err', err);
        });
    },
    jurisdiction6() {
      this.$http
        .get('/sys/dict/data/page?dictTypeId=6')
        .then(({ data: res }) => {
          if (res.code !== 0) {
            return this.$message.error(res.msg);
          } else {
            this.dingdanArr6 = res.data.list;
            this.dingdanArr6.forEach((item) => {
              if (item.id == '25') {
                this.xxtzForm.cyjsYouxiang = item.dictValue;
              }
              if (item.id == '26') {
                this.xxtzForm.cyjsXiaoxi = item.dictValue;
              }
              if (item.id == '27') {
                this.xxtzForm.cyyqYouxiang = item.dictValue;
              }
              if (item.id == '28') {
                this.xxtzForm.cyyqXiaoxi = item.dictValue;
              }
              if (item.id == '29') {
                this.xxtzForm.xcyYouxiang = item.dictValue;
              }
              if (item.id == '30') {
                this.xxtzForm.xcyXiaoxi = item.dictValue;
              }
              if (item.id == '31') {
                this.xxtzForm.cyzdYouxiang = item.dictValue;
              }
              if (item.id == '32') {
                this.xxtzForm.cyzdXiaoxi = item.dictValue;
              }
              if (item.id == '33') {
                this.xxtzForm.cyycYouxiang = item.dictValue;
              }
              if (item.id == '34') {
                this.xxtzForm.cyycXiaoxi = item.dictValue;
              }
            });
          }
        })
        .catch((err) => {
          console.log('err', err);
        });
    },
    switchChange(val, id) {
      setTimeout(() => {
        this.$http
          .put('/sys/dict/data', { dictValue: val, id: id })
          .then(({ data: res }) => {
            if (res.code !== 0) {
              return this.$message.error(res.msg);
            } else {
              if (val != 0) {
                this.$message.success(this.$t('personPre.pianhao28'));
              } else {
                this.$message.success(this.$t('personPre.pianhao29'));
              }
            }
          })
          .catch((err) => {
            console.log('err', err);
          });
      }, 100);
    },
  },
};
</script>

<style lang="scss" scoped>
.personPre {
  background: white;
  width: 800px;

  .person_nav {
    font-size: 20px;
    font-family: PingFang SC;
    font-weight: 500;
    color: #003e67;
    line-height: 28px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .orderReceiving {
    background: rgba(0, 62, 103, 0.39);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    width: 450px;
    border-radius: 6px;

    span {
      font-size: 14px;
      font-weight: 400;
      color: #003e67;
    }
  }

  .switch_inner {
    margin-top: 20px;
  }

  .type_title {
    margin-top: 40px;
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 16px;
  }

  .switch_item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;

    .item_title {
      width: 150px;
      font-size: 14px;
      font-weight: 500;
      color: #333333;
      white-space: nowrap; /* 不换行 */
      overflow: hidden; /* 超出部分隐藏 */
      text-overflow: ellipsis; /* 超出部分显示省略号 */
      display: inline-block;
    }

    .switch {
      padding: 10px 0;
      display: flex;
      align-items: center;

      .item_email {
        display: flex;
        align-items: center;

        span {
          margin-right: 12px;
          font-weight: 400;
          font-size: 14px;
          color: #333333;
        }
      }

      .item_phone {
        display: flex;
        align-items: center;
        margin-left: 80px;
        margin-right: 40px;

        span {
          margin-right: 12px;
          margin-right: 12px;
          font-weight: 400;
          font-size: 14px;
          color: #333333;
        }
      }
    }
  }
}
</style>
